#include #include #include using namespace std; int roll() { int dieOne = rand()%6 + 1; int dieTwo = rand()%6 + 1; cout << "Roll -- " << dieOne << " + " << dieTwo << " = " << dieOne + dieTwo << endl; return dieOne + dieTwo; } void main() { int dieOne; int dieTwo; srand(time(NULL)); char junk; int total = 0; for(int i = 0; i < 10; i++) { total += roll(); //system("pause"); cout << "Press any key to roll again" << endl; getch(); } cout << total << endl; } //////////////////////////////////////////////////////////////////////////////////////////// #include using namespace std; //x and y are parameters void displayMax(int x, int y) { if(x > y) { cout << x; } else { cout << y; } } void fun3() { cout << "Hi mom" << endl; } void fun2() { fun3(); } void fun1() { fun2(); } void main() { // arguments, parameters //6 and 3 are arguments displayMax(6,3); int i = 9; int j = 8; displayMax(i, 65); fun1(); }